/**
 * 
 */
package de.wesemann.jdedun.implementation.district;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.wesemann.jdedun.entities.district.statistics.DistrictStatistic;
import de.wesemann.jdedun.entities.district.statistics.DistrictStatisticsContainer;
import de.wesemann.jdedun.entities.district.streets.DistrictStreetsContainer;
import de.wesemann.jdedun.implementation.AbstractResource;
import de.wesemann.jdedun.implementation.ImplementationInterface;

/**
 * @author spinner0815
 * 
 */
public class DistrictStatisticsImpl implements ImplementationInterface {

    private String urlStub = "district/statistics";
    private Logger logger = LoggerFactory
	    .getLogger(DistrictStatisticsImpl.class);
    private AbstractResource resource = new AbstractResource(urlStub);

    public int count() {
	return resource.count();
    }

    public List<DistrictStatistic> getAll() {
	return resource.getAll(DistrictStatisticsContainer.class).getData();
    }

    public List<DistrictStatistic> getFirstN(int n) {
	return resource.get(n, 0, DistrictStatisticsContainer.class).getData();
    }

    public List<DistrictStatistic> getNextN(int n, int offset) {
	return resource.get(n, offset, DistrictStatisticsContainer.class)
		.getData();
    }

    public List<DistrictStatistic> search(Map<String, String> searchTupel) {
	return resource.search(searchTupel, DistrictStatisticsContainer.class)
		.getData();
    }

    public String getURLStub() {
	return this.urlStub;
    }

    public void setURLStub(String urlStub) {
	this.urlStub = urlStub;
    }

}
